<?php

namespace App\Http\Requests;

class Ad extends Base
{

    public function rules()
    {
        $rules = [
            //unique:表名,字段名,排除ID,主键字段,条件字段,条件,
            'title' => 'required',
            'thumb' => 'required',
            'link'  => 'required|url',
        ];
        return $rules;

    }

    public function messages()
    {
        return [
            'title.required' => '请填写广告名称',
            'thumb.required' => '请上传广告图片',
            'link.required'  => '请填写广告链接地址',
            'link.url'       => '广告链接地址不合法',
        ];
    }
}
